<?php
	$REP_CLASS = $_SERVER['DOCUMENT_ROOT'] . '/class/' ;
	include_once $REP_CLASS.'Association.php';
	include_once $REP_CLASS . 'AssocPDO.php';
	$db = new AssocPDO();

	$reponse="ko";
  if ( isset($_GET) )
  {
    extract($_GET);
   	$assoc = new Association($db);
   	$assoc->setRefassociation($refassociation);
    $lst = $assoc->rechInfosGeo();

    foreach($lst as $req)
	{
		$reponse='ok';
		$dept=$req["dept"];
		$insee=$req["insee"];
		$libcommune=$req["libelle"]." (".$req["cp"].")";
	}
  }
?>
<?php header('Content-type: text/xml; charset=UTF-8'); ?>
<?xml version="1.0" encoding="UTF-8"?>
<root>
<retour><?php echo $reponse ?></retour>
<insee><?php echo $insee ?></insee>
<dept><?php echo $dept ?></dept>
<libcommune><?php echo $libcommune ?></libcommune>
</root>